home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_ambtoweryard.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  136 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_AmbTowerYard.cog
  4. #
  5. # Plays random ambient sounds at random positions and drops
  6. # snow at all the positions all the time.
  7. #
  8. # [TRM]
  9. #
  10. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message        entered
  16.     message     pulse
  17.  
  18.     thing        soundPos0        nolink
  19.     thing        soundPos1        nolink
  20.     thing        soundPos2        nolink
  21.     thing        soundPos3        nolink
  22.     thing        soundPos4        nolink
  23.     thing       singlePos       nolink
  24.     
  25.     sector      start_Amb1      linkID=1
  26.     sector      start_Amb2      linkID=1
  27.     sector      start_Amb3      linkID=1
  28.     sector      start_Amb4      linkID=1
  29.     sector      start_Amb5      linkID=1
  30.     
  31.     sector      start_Single
  32.     sector      sec_Temp
  33.     
  34.     sector      stop_Amb1       linkID=0
  35.     sector      stop_Amb2       linkID=0
  36.     sector      stop_Amb3       linkID=0
  37.     sector      stop_Amb4       linkID=0
  38.     
  39.     sound        ambient0=shw_amb1.wav   local
  40.     sound        ambient1=shw_amb2.wav   local
  41.     sound        ambient2=shw_amb3.wav   local
  42.     sound        ambient3=shw_amb4.wav   local
  43.     sound        ambient4=shw_amb5.wav   local
  44.     sound        ambient5=shw_amb6.wav   local
  45.     sound        ambient6=shw_amb7.wav   local
  46.     
  47.     template    tpl_Snow=skitosnow      local       # 20m rad snow
  48.     template    tpl_Tim=timsnow         local       # 5m rad snow
  49.     
  50.     int         playing=0               local
  51.     int         single=0                local
  52.     int         randNum=0               local
  53.     
  54.     int         randWolf                local
  55.     sound       snd_Wolf=fol_wolf_talk.wav      local
  56.     
  57. end
  58.  
  59. # ========================================================================================
  60.  
  61. code
  62.  
  63. entered:
  64.  
  65.     if((GetSenderID() == 1) && (playing == 0))
  66.     {
  67.         playing = 1;
  68.         single = 0;
  69.         setpulse(2.0);
  70.     }
  71.     
  72.     if(GetSenderID() == 0)
  73.     {
  74.         playing = 0;
  75.         SetPulse(0.0);
  76.     }
  77.     
  78.     if((GetSenderRef() == start_Single) && (playing == 0))
  79.     {
  80.         playing = 1;
  81.         single = 1;
  82.         SetPulse(2.0);
  83.     }
  84.     
  85.     if(GetSenderRef() == sec_Temp) playing = 0;
  86.     
  87.     return;
  88.  
  89. # ========================================================================================
  90.  
  91. pulse:
  92.  
  93.     if(single == 0)
  94.     {
  95.         PlaySoundThing(ambient0[RandBetween(0, 6)], soundPos0[RandBetween(0, 4)], 1.0, 15, 30, 0);
  96.         
  97.         randWolf = RandBetween(1, 10);
  98.     
  99.         if(randWolf == 5)
  100.         {
  101.             PlaySoundThing(snd_Wolf, soundPos0[RandBetween(0, 7)], 0.5, 15, 30, 0);
  102.         }
  103.         
  104.         if(GetPerformanceLevel() >= 2)
  105.         {
  106.             CreateThing(tpl_Snow, soundPos0);        
  107.             CreateThing(tpl_Snow, soundPos1);        
  108.             CreateThing(tpl_Snow, soundPos2);        
  109.             CreateThing(tpl_Snow, soundPos3);        
  110.             CreateThing(tpl_Snow, soundPos4);
  111.         }
  112.     }
  113.     
  114.     else
  115.     {
  116.         #Print("AmbTowerYard: singlePos");
  117.         
  118.         randNum = RandBetween(1, 3);
  119.         
  120.         if(randNum == 1)
  121.         {
  122.             PlaySoundThing(ambient0[RandBetween(0, 6)], singlePos, 1.0, 5, 20, 0);
  123.         }
  124.         
  125.         if(GetPerformanceLevel() >= 2)
  126.         {
  127.             CreateThing(tpl_Tim, singlePos);
  128.         }
  129.     }
  130.     
  131.     return;
  132.  
  133. # ========================================================================================
  134.  
  135. end
  136.